<!doctype html>
<html>
<head>
    <include file="public:headtop"/>
    <link href="/static/css/general.css" rel="stylesheet">
    <link href="/static/css/center.css" rel="stylesheet">
</head>

<body>
<include file="public:headmini1"/>
<div class="order-box">
    <div class="order ope">我的收藏</div>
    <div class="media-list" style="margin-top: 15px;">
        <volist name="item_collection" id="vo">
            <a href="{: U('Item/index', array('id' => $vo['id']))}">
                <div class="media">
                    <h3 class="media-title text-tract">
                        {$vo.goods}
                    </h3>
                    <span class="media-text">
                        <span class="media-text-item">单价：￥{$vo.price}</span>
                        <a class="float-right btn btn-sm deldata" data="{$vo.id}">删除</a>
                    </span>
                </div>
            </a>
        </volist>
    </div>

</div>
<script>
    $(function () {
        $('.deldata').click(function () {
            var id = parseInt($(this).attr('data'));
            if (id > 0 && typeof(id) == 'number') {
                $.post(
                        "{:U('User/coll_del')}",
                        {id: id},
                        function (ref) {
                            ref = eval("(" + ref + ")");
                            alert(ref.msg);
                            if (ref.status) {
                                location.reload();
                            }
                        }
                );
            } else {
                alert('请确认提供的数据的准确性！');
            }
        })
    });
</script>
</body>
</html>